<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class thongke extends CI_Controller {

	public function __construct() {
		parent::__construct();
		$this->load->model('model_thongke');
		date_default_timezone_set("Asia/Ho_Chi_Minh");
		$this->load->library('grocery_CRUD');
	}
	// toan truong
	public function hocsinh()
	{
		$y = $this->input->post('namtk');
		$hk = $this->input->post('hocky');
		if($y==NULL) $y=date('y');
		$data['hocluc']=$this->model_thongke->hocluc($y,$hk);
		$data['hanhkiem']=$this->model_thongke->hanhkiem($y,$hk);
		
		$this->load->view('view_header');
		$this->load->view('admin/view_menu');
		$this->load->view('admin/view_thongke',$data);
		$this->load->view('view_footer');
		
	}
	public function nghihoc()
	{
		$data['nghihoc']=$this->model_thongke->nghihoc();
		
		$this->load->view('view_header');
		$this->load->view('admin/view_menu');
		$this->load->view('admin/view_nghihoc',$data);
		$this->load->view('view_footer');
	}
	// thong ke hanh kiem,hoc luc cua khoi
	
	public function hocluckhoi($khoi)
	{
		$y = $this->input->post('namtk');
		$hk = $this->input->post('hocky');
		if($y==NULL) $y=date('y');
		$data['hlkhoi']=$this->model_thongke->hocluckhoi($y,$hk,$khoi);
		$data['hkkhoi']=$this->model_thongke->hanhkiemkhoi($y,$hk,$khoi);
		$this->load->view('view_header');
		$this->load->view('admin/view_menu');
		$this->load->view('admin/view_hocluckhoi',$data);
		$this->load->view('view_footer');
	}
	
}